<cfcomponent output="false">
	<cfscript>
		/**
		* 	cast data to array Method
		* 	@name asArray
		* 	@access public
		* 	@author Paulo Teixeira
		*	@date 2012-05-22
		*	@return Array
		**/
		public Array function asArray( Any data ) {
			var adapter = variables.factory.getDitionary("ArrayDriver");
			
			return adapter.asArray( data : arguments.data );
		}
		
		/**
		* 	cast data to query Method
		* 	@name asQuery
		* 	@access public
		* 	@author Paulo Teixeira
		*	@date 2012-05-25
		*	@return Query
		**/
		public Query function asQuery( Any data ) {
			var adapter = variables.factory.getDitionary("QueryDriver");
			
			return adapter.asQuery( data : arguments.data );
		}
		
		/**
		* 	Domain get adapter intance Method
		* 	@name getAdapter
		* 	@access private
		* 	@author Paulo Teixeira
		*	@date 2012-05-22
		*	@return Any
		**/
		private Any function getAdapter( Any data ) {
			if( IsArray( arguments.data ) == true ) {
				return variables.factory.getDitionary("ArrayDriver");
			}
			else if( IsQuery( arguments.data ) == true ) {
				return Application.instance.factory.getDitionary("QueryDriver");
			}
			else if( IsStruct( arguments.data ) == true ) {
				return Application.instance.factory.getDitionary("StructDriver");
			}
			else if( ListLen( arguments.data ) gt 0 ) {
				return Application.instance.factory.getDitionary("ListDriver");
			}
			else {
				variables.error = Application.instance.factory.getModels("Error");
				variables.error.handlerError( Application.config.customExceptionUser , "The object data not is in a valid data type or is empty" );
			}
		}
	</cfscript>
</cfcomponent>